import request from '@/utils/request'

// 获取购物车列表
export const getCartList = () => request.get('/shoppingCart/list')

// 添加到购物车
export const addFoodToCart = (data) => request.post('/shoppingCart/add', data)

// 获取购物车数量
export const getCartCount = () => request.get('/shoppingCart/count')

// 更新购物车项数量
export const updateCartItemCount = (data) => request.put('/shoppingCart/update', data)

// 删除购物车项
export const deleteCartItem = (id) => request.delete(`/shoppingCart/delete/${id}`)

// 清空购物车
export const clearCart = () => request.delete('/shoppingCart/clean')